<template>
	<view >
		<template v-if="type === 'order'">
			<view class="e-p-30 e-m-b-20 bg-white overflow-hidd" style="border-radius:0 0 20rpx 20rpx">
				<view class="e-flex e-flex-between c-regular e-m-b-20">
					<text>{{ $t('order.商品总价') }}</text>
					<text>{{$unitEn}}{{info.orderMoney}}</text>
				</view>
				<view class="e-flex e-flex-between c-regular e-m-b-20" v-if="info.orderMoneyCoupon">
					<text>{{ $t('order.店铺优惠') }}</text>
					<text>-{{$unitEn}}{{info.orderMoneyCoupon}}</text>
				</view>
				<view class="e-flex e-flex-between c-regular e-m-b-20">
					<text>{{ $t('order.运费') }}</text>
					<text>+{{$unitEn}}{{info.orderFreight || info.orderDeliveryfee}}</text>
				</view>
				<view class="e-flex e-flex-between c-regular e-m-b-20" v-if="info.orderMoneyCouponSys">
					<text>{{ $t('order.平台优惠') }}</text>
					<text>-{{$unitEn}}{{info.orderMoneyCouponSys}}</text>
				</view>
				<view class="e-flex e-flex-between c-regular e-m-b-20" v-if="info.orderMoneyDeduction">
					<text>{{ $t('order.抵扣') }}</text>
					<text>-{{$unitEn}}{{info.orderMoneyDeduction}}</text>
				</view>
				<view class="e-flex e-flex-between c-4d" v-if="info.receivingStatus !== 5">
					<text>{{ $t('order.实付金额') }}</text>
					<text>{{$unitEn}}{{info.orderMoneyPay}}</text>
				</view>
				<view class="e-flex e-flex-between c-4d" v-else>
					<text>{{ $t('order.amountPayable') }}</text>
					<text>{{$unitEn}}{{info.orderMoneyPay}}</text>
				</view>
			</view>
			<view class="e-p-30  bg-white e-radius-20 overflow-hidd">
				<view class="e-m-b-30">
					<text class="fw-500">订单信息</text>
				</view>
				<view class="e-m-b-30">
					<e-line></e-line>
				</view>
				<view class="e-flex e-flex-between">
					<text class="c-98">{{ $t('order.订单备注') }}：</text>
					<text>{{info.orderRemarks||''}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" @tap="$copy(info.orderId)">
					<text class="c-98">{{ $t('order.订单编号') }}：</text>
					<view class="e-flex">
						<text>{{info.orderId}}</text>
						<view class="e-m-l-20" >
							<app-image :size="['32rpx']" src="order/copy.png" />
						</view>
					</view>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.payId">
					<text class="c-98">{{ $t('order.支付流水号') }}：</text>
					<text>{{info.payId}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.createTime">
					<text class="c-98">{{ $t('order.下单时间') }}：</text>
					<text>{{info.createTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.payTime">
					<text class="c-98">{{ $t('order.付款时间') }}：</text>
					<text>{{info.payTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.deliverTime">
					<text class="c-98">{{ $t('order.发货时间') }}：</text>
					<text>{{info.deliverTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.receivingTime">
					<text class="c-98">{{ $t('order.完成时间') }}：</text>
					<text>{{info.receivingTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.distributionTime">
					<text class="c-98">{{ $t('classify.配送时间') }}：</text>
					<text>{{info.distributionTime}}</text>
				</view>
				<!-- behalfUserNickname存在标识代付订单 -->
				<template v-if="info.behalfUserNickname && isDFK !=='1'">
					<view class="u-m-b-10">
						<text>{{ $t('nearby.支付方式') }}：</text>
						<text>代付款</text>
					</view>
					<view class="u-m-b-10">
						<text>代付人：</text>
						<text>{{ info.behalfUserNickname }}</text>
					</view>
				</template>
				<template v-else>
					<view class="e-p-t-20 e-flex e-flex-between">
						<text class="c-98">{{ $t('nearby.支付方式') }}：</text>
						<text>{{ info.orderPayName }}</text>
					</view>
					<view class=" e-p-t-20 e-flex e-flex-between" v-if="info.orderPayType === 'OFFLINE'">
						<text class="c-98">{{ $t('nearby.支付凭证') }}：</text>
						<view class="order-info-btn c-secondary e-font-20" @tap="$emit('preview')">
							{{ $t('nearby.查看凭证') }}
						</view>
					</view>
				</template>
				<view v-if="info.expressName " class="e-p-t-20 e-flex e-flex-between" @tap="handleWebSite">
					<text class="c-98">{{ $t('order.物流公司') }}：</text>
					<view class="e-flex">
						<text>{{info.expressName}}</text>
						<view class="e-m-l-20" v-if="info.expressWebsite" >
							<app-image :size="['32rpx']" src="order/copy.png" />
						</view>
					</view>
					
				</view>
				<view v-if="info.expressNumber" class="e-p-t-20 e-flex e-flex-between">
					<text class="c-98">{{ $t('order.物流单号') }}：</text>
					<view class="e-flex">
						<text>{{info.expressNumber}}</text>
						<image :src="$staticPath('order/copy.png')" class="img-32 e-m-l-20"
							@tap="$copy(info.expressNumber)"></image>
					</view>
				</view>
				<view class="e-flex e-flex-between" v-if="info.updateRemarks">
					<text class="c-98">{{ $t('order.退款原因') }}：</text>
					<text>{{info.updateRemarks}}</text>
				</view>
			</view>
		</template>
		<template v-else>
			<view class="e-p-30 bg-white">
				
				<view class="e-flex e-flex-between">
					<text class="c-98">{{ $t('order.退款原因') }}：</text>
					<text>{{info.buyerMsg}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between">
					<text class="c-98">{{ $t('order.退款金额') }}：</text>
					<text>{{$unitEn}}{{info.refundAmount}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between">
					<text class="c-98">{{ $t('order.申请时间') }}：</text>
					<text>{{info.createTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.refundSts === 0">
					<text class="c-98">{{ $t('order.关闭时间') }}：</text>
					<text>{{info.handelTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.refundSts === 3">
					<text class="c-98">{{ $t('order.拒绝时间') }}：</text>
					<text>{{info.handelTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.refundTime">
					<text class="c-98">{{ $t('order.退款时间') }}：</text>
					<text>{{info.refundTime}}</text>
				</view>
				<view class="e-p-t-20 e-flex e-flex-between" v-if="info.refundExplain">
					<text class="c-98">{{ $t('order.拒绝原因') }}：</text>
					<text>{{info.refundExplain}}</text>

				</view>
				<view v-if="info.expressName" class=" e-p-t-20 e-flex e-flex-between" @tap="handleWebSite">
					<text class="c-98">{{ $t('order.物流公司') }}：</text>
					<view class="e-flex">
						<text>{{info.expressName}}</text>
						<view class="e-m-l-20" v-if="info.expressWebsite" >
							<app-image :size="['32rpx']" src="order/copy.png" />
						</view>
					</view>
				</view>
				<view v-if="info.expressNumber" class="e-flex e-p-t-20 e-flex-between">
					<text class="c-98">{{ $t('order.物流单号') }}：</text>
					<view class="e-flex">
						<text>{{info.expressNumber}}</text>
						<view class="e-m-l-20" @tap="$copy(info.expressNumber)">
							<app-image :size="['32rpx']" src="order/copy.png" />
						</view>
					</view>
				</view>
			</view>
		</template>


	</view>
</template>

<script>
	export default {
		// #ifdef MP-WEIXIN
		// 将自定义节点设置成虚拟的，更加接近Vue组件的表现
		options: {
			virtualHost: true
		},
		// #endif
		props: {
			info: Object,
			type: {
				type: String,
				default: 'order'
			},
			isDFK:{
				type:String,
				default:'0'
			}
		},
		methods: {
			handleWebSite() {
				this.$copy(this.info.expressWebsite)
			}
		}
	}
</script>

<style scoped>
	.c-4d {
		color: #4d4d4d;
	}

	.c-98 {

		color: #989898;
	}

	.order-info-btn {
		border-radius: 20rpx;
		border: 2rpx solid #999999;
		padding: 6rpx 12rpx;
	}
</style>